<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="${ctxPath!}/layui/css/layui.css" rel="stylesheet" type="text/css">
    <% include("/templates/common/dialog.html"){} %>
</head>
<div style="padding:10px 50px 10px 10px">
    <form id="workerForm" method="post" action="${ctxPath!}/sys/worker/edit" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">Excel文件：</label>
            <div class="layui-input-block">
                <input class="layui-input" type="hidden" id="file_src"/>
                <button type="button" class="layui-btn" id="uploadButton">
                    <i class="layui-icon">&#xe67c;</i>上传Excel文件
                </button>
            </div>
        </div>
    </form>
        <!--<div class="layui-form-item">-->
            <!--<div class="layui-input-block">-->
                <!--<a href="${ctxPath!}/upload/Excel_Template.xls" download="Excel_Template.xls" class="layui-btn">点击下载Excel模板文件</a>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="layui-form-item">-->
            <!--<div class="layui-input-block">-->
                <!--<button id="insertDataInfo" class="layui-btn" lay-submit lay-filter="*">录入文件中数据点信息</button>-->
            <!--</div>-->
        <!--</div>-->
</div>
<script src="${ctxPath!}/jquery/jquery.min.js"></script>
<script src="${ctxPath!}/layui/layui.js"></script>
<script src="${ctxPath!}/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
<script src="${ctxPath!}/jqgrid/myjqGrid.js?v=1.0.1"></script>
<script type="text/javascript">

    var buildingId,deviceId;

    layui.use(['form','upload'], function(){
        var form=layui.form;
        var upload =layui.upload;
        //上传缩略图
        upload.render({
            elem: '#uploadButton',
            url: '${ctxPath!}/sys/worker/upload?orgId=${session.cUser.orgId!}',
            method : "POST",
            auto: true,
            accept: 'file',
            exts: 'xls|xlsx',
            done: function(data){
                if(data.status == 200){
                    layer.alert(data.msg, {
                        icon: 1,
                        skin: 'layer-ext-moon'
                    },function () {
                        parent.myJqGrid.reloadGrid({});
                        parent.layer.closeAll();
                    });
                }else{
                    layer.alert(data.msg, {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    });
                }
            }
        });
    });

    layui.use(['form','upload'], function(){
        var form = layui.form;
    });
    function closeAll() {
        parent.layer.closeAll();
    }
</script>